import request from '@/api/request.js'


export default {
  // 产线列表
  ProlineList(form){
    return request({
      url:'/eProline/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{}
    })
  },


  // 产线添加
  ProlineListAdd(form){
    return request({
      url:'/eProline/insert',
      method:'post',
      data:{
        prolineId:form.prolineId,
        prolineName:form.prolineName,
        description:form.description,
        spectralEquipment:form.spectralEquipment
      }
    })
  },


  // 产线删除
  ProlineListDelete(prolineId){
    return request({
      url:'/eProline/delete',
      method:'post',
      data:{
        prolineId
      }
    })
  },

  // 产线编辑
  ProlineListEdit(form,oldProlineId){
    return request({
      url:'/eProline/update',
      method:'post',
      data:{
        prolineId : form.prolineId,
        prolineName:form.prolineName,
        spectralEquipment:form.spectralEquipment,
        description:form.description,
        oldProlineId
      }
    })
  },





  // 产线设备查询  产线id
  prolineEquiPQuery(form,prolineId){
    return request({
      url:'/eEquipline/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{
        prolineId
      }
    })
  },

  // 产线作业查询 产线id
  prolineWorkQuery(form,prolineId){
    return request({
      url:'/eLinework/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{
        prolineId
      }
    })
  },

  // 添加产线设备
  insertProlineEquip(form){
    return request({
      url:'/eEquipline/insert',
      method:'post',
      data:{
        equipmentId : form.equipmentId,
        deviceStatus : form.deviceStatus,
        utilization:form.utilization,
        enter:form.enter,
        output:form.output,
        process:form.process,
        prolineEquipName:form.prolineEquipName,
        prolineId:form.prolineId,
        promentId:form.promentId,
        status:form.status,
        yield:form.yield
      }
    })
  },


  // 产线设备 状态改变
  ProlineEquipStatus(deviceStatus,prolineId,promentId){
    return request({
      url:'/eEquipline/update',
      method:'post',
      data:{
        deviceStatus,
        oldProlineId:prolineId,
        oldPromentId:promentId,
        prolineId,
        promentId
      }
    })
  },

  // 产线设备 删除
  ProlineEquipDelete(promentId,prolineId){
    return request({
      url:'/eEquipline/delete',
      method:'post',
      data:{
        promentId,
        prolineId
      }
    })
  },


  // 产线作业添加
  ProlineWorkAdd(form){
    return request({
      url:'/eLinework/insert',
      method:'post',
      data:{
        prolineId:form.prolineId,
        taskId:form.taskId,
        taskName:form.taskName,
        planningTime:form.planningTime,
        completionRate:form.completionRate,
        enter:form.enter,
        output:form.output,
        yield:form.yield,
        utilization:form.utilization,
        finishedCondition:form.finishedCondition,
      }
    })
  },


  // 产线作业 删除
  ProlineWorkDelete(taskId,prolineId){
    return request({
      url:'/eLinework/delete',
      method:'post',
      data:{
        taskId,
        prolineId
      }
    })
  },

  // 产线设备 状态改变
  ProlineWorkStatus(finishedCondition,prolineId,taskId){
    return request({
      url:'/eLinework/update',
      method:'post',
      data:{
        finishedCondition,
        oldProlineId:prolineId,
        oldTaskId:taskId,
        prolineId,
        taskId
      }
    })
  },
  
  
}
